<template>
  <el-card class="box-card " shadow="never" >
    <div slot="header">
      <span>🥳 每日一句</span>
    </div>
    <div>
      <div class="has-text-left block">
        {{ tip.content }}
      </div>
      <div class="has-text-right mt-5 block">
        ——{{ tip.author }}
      </div>
      <!-- <div v-for="(item, index) in Alltip" :key="index" >{{item.id}}</div> -->
    </div>
  </el-card>
</template>

<script>
import { getTodayTip } from '@/api/tip'

export default {
  name: 'Tip',
  data () {
    return {
      tip: {},
      Alltip: []
    }
  },
  created () {
    this.fetchTodayTip()
    // this.fetchAllTodayTip()
  },
  methods: {
    fetchTodayTip () {
      getTodayTip().then(response => {
        const { data } = response
        this.tip = data
      })
    }
    // fetchAllTodayTip () {
    //   getAllTodayTip().then(response => {
    //     const data = response.data
    //     this.Alltip = data
    //     console.log(this.Alltip)
    //   })
    // }
  }
}
</script>

<style scoped>

</style>
